package com.xframe.domain.e3sp.bu.overseas;

import com.xframe.domain.BaseModel;
import com.xframe.domain.e3sp.maindata.Coin;
import com.xframe.domain.e3sp.maindata.Country;
import com.xframe.domain.e3sp.maindata.ForeignDealer;
import com.xframe.xdal.core.annotation.*;
import com.xframe.xdal.core.constant.AutoFillType;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;


/**
 * com.xframe.domain.e3sp.bu.overseas.OverBadStock
 * @author zjj
 * @create 2024/4/18 9:28
 */
@Data
@Accessors(chain=true)
@XTable(value = "bu_t02_badstock", label = "海外滞销库存表",dataSourceCode = "warehouse")
@XBelongsTo(typeName = "com.xframe.domain.e3sp.maindata.ForeignDealer",foreignKey = "dealerId", targetKey = "dealerId",as = "reForeignDealer")
@XBelongsTo(typeName = "com.xframe.domain.e3sp.maindata.Country",foreignKey = "countryId", targetKey = "countryId",as = "refCountry")
@XBelongsTo(typeName = "com.xframe.domain.e3sp.maindata.Coin",foreignKey = "coinId", targetKey = "coinId",as = "refCoin")
public class OverBadStock extends BaseModel {

    /**
     * 滞销库存ID
     */
    @AutoFill(AutoFillType.Snowflake)
    @XColumn(name = "badstock_id", primaryKeyFlag = true,desc = "滞销库存ID")
    private Long badstockId;

    /**
     * 备件清单ID
     */
    @XColumn(name = "spare_part_id", desc = "备件清单ID")
    private Long sparePartId;

    /**
     * 备件编码(自动带出)
     */
    @XQueryCondition
    @XColumn(name = "spare_part_no", desc = "备件编码",length = 50,readonly = true)
    private String sparePartNo;

    /**
     * 备件名称(自动带出)
     */
    @XQueryCondition
    @XColumn(name = "spare_part_name", desc = "备件名称",length = 100,readonly = true)
    private String sparePartName;

    /**
     * 备件英文名称(自动带出)
     */
    @XColumn(name = "spare_part_name_en", desc = "备件英文名称",nullFlag = true,length = 100,readonly = true)
    private String sparePartNameEn;

    /**
     * 库存数量
     */
    @XColumn(name = "st_num", desc = "库存数量")
    private Integer stNum;

    /**
     * 海外经销商ID
     */
    @XColumn(name = "dealer_id", desc = "海外经销商ID",readonly = true)
    private Long dealerId;

    /**
     * 国家ID
     */
    @XQueryCondition
    @XColumn(name = "country_id", desc = "国家ID",readonly = true)
    private Long countryId;

    /**
     * 货币ID
     */
    @XColumn(name = "coin_id", desc = "货币ID",readonly = true)
    private Long coinId;

    /**
     * 联系电话
     */
    @XColumn(name = "contact_phone", desc = "联系电话")
    private String contactPhone;

    /**
     * 有效日期
     */
    @XQueryCondition
    @XColumn(name = "effective_date", desc = "有效日期")
    private Date effectiveDate;

    /**
     * 备注
     */
    @XColumn(name = "remark", desc = "备注")
    private String remark;

    /**
     * 海外经销商信息
     */
    private ForeignDealer reForeignDealer;

    /**
     * 国家
     */
    private Country refCountry;

    /**
     * 货币
     */
    private Coin refCoin;


}
